﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Telerik.Web.UI;
using System.IO;
using KPIS.GERP.ESS.BLL;
using KPIS.GERP.ESS.MODEL;
using _WebShared.Classes;
using KPIS.GERP.ESS.APP.App_UI.Commons;

namespace KPIS.GERP.ESS.APP.App_UI.Forms
{
    public partial class ESS_ProjectHistory : System.Web.UI.Page
    {
        Main main = new Main();
        BGM_ProjectOperation.BGM_ProjectOperation pj = new BGM_ProjectOperation.BGM_ProjectOperation();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //======= test only =========
                //Session["EmpSeq"] = "1";
                //===========================

                //UpdateUI1("ViewAll");
            }
        }

        protected void LoadRadGrid1()
        {
            RadGrid1.DataSource = pj.GetFull(null, null, Session["UserInternalJobsiteSeq"].ToString()
                , null, null, false, false);
        }

        protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            if (!e.IsFromDetailTable)
            {
                LoadRadGrid1();
            }
        }

        protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
            {
                ((ImageButton)RadGrid1.Items[e.Item.ItemIndex]["Delete"].FindControl("cmdDelete")).Visible
                    = RadGrid1.Items[e.Item.ItemIndex]["record_status"].Text != "A";
            }
        }

        //==========================================================================
    }
}
